<template>
  <div>
    <div @click="change_tab" class="tab-btn">
      <p name="personal" :class="{ active: name == 'personal' }">个人</p>
      <p name="enterprise" :class="{ active: name == 'enterprise' }">企业</p>
      <p name="photographer" :class="{ active: name == 'photographer' }">
        摄影师
      </p>
    </div>
    <el-form ref="form_login" :model="form_login">
      <el-form-item label="手机号">
        <el-input v-model="form_login.phone"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="form_login.pwd"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button>登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: "personal",
      form_login: {
        phone: "",
        pwd: "",
      },
    };
  },
  methods: {
    change_tab(e) {
      this.name = e.target.getAttribute("name");
    },
  },
};
</script>

<style lang="scss" scoped>
.tab-btn {
  margin: 20px 0;
  display: flex;
  p {
    flex: 1;
    text-align: center;
    border: 1px solid #dbe0df;
    font-size: 16px;
    height: 48px;
    line-height: 48px;
    cursor: pointer;
    &.active {
      background-color: #f4f7f6;
    }
  }
}
</style>
